import 'package:flutter/material.dart';
import 'package:ancient_poetry/other/TangPoetry_sata.dart';

// 展示该诗的详情内容
class HomeSubOne extends StatelessWidget {

  final int? indexValue;

  HomeSubOne({Key? key, this.indexValue }) : super(key: key);


  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('详情-$indexValue'),
        ),
        body: HomeSubOneController(indexRow:indexValue)
    );
  }
}

class HomeSubOneController extends StatelessWidget {

  final int? indexRow;

  HomeSubOneController({Key? key, this.indexRow }) : super(key: key);

  Widget _listItemBuilder(BuildContext content, int index) {
    //index = 0;
    index = this.indexRow!;
    return Container(
      color: /*(index%2==0?Colors.white:Colors.lightBlue)*/Colors.white70,
      margin: EdgeInsets.all(10),
      child: Column(
        children: <Widget>[
          Text(
            bookOfSongsGuoFengZhouNan[index].title??'',
            style: Theme.of(content).textTheme.titleMedium,
          ),
          Text(
            bookOfSongsGuoFengZhouNan[index].author??'',
            style: Theme.of(content).textTheme.titleSmall,
          ),
          Padding(
            padding: EdgeInsets.only(bottom: 32.0),
          ),
          Text(
            bookOfSongsGuoFengZhouNan[index].contents??''.replaceAll("。", "。\n"),
            style: Theme.of(content).textTheme.titleSmall,
          ),
          Padding(
            padding: EdgeInsets.only(bottom: 42.0),
          ),
          Text(
            bookOfSongsGuoFengZhouNan[index].notes??'',
            style: Theme.of(content).textTheme.titleSmall,
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: 1,
      itemBuilder: _listItemBuilder,
    );
  }
}
